<template>
	<cxView margin="0 20rpx">
		<u-navbar :is-fixed="true" :background="{background:'transparent'}" :is-back="false" :borderBottom="false"
			title="个人中心">

		</u-navbar>
		<cxView background="linear-gradient(to bottom, #FEE615 0%, white 100%)" width="100%" height="600"
			position="fixed" :zIndex="-20" top="0" left="0" right="0" />
		<uni-row>
			<uni-col :span="22">
				<cxView display="flex">
					<cxImg src="/static/header.png" width="120" height="120"></cxImg>
					<cxView margin-left="20">
						<cxView>
							这是昵称
						</cxView>
						<cxView display="flex" align-items="center" margin="20rpx 0 0 0">
							邀请码:12312312
							<cxImg size="30" src="/static/me/copy.png" margin="0 0 0 20rpx"></cxImg>
						</cxView>
					</cxView>
				</cxView>
			</uni-col>
			<uni-col :span="2">
				<cxView display="flex" height="100" align-items="center">
					<cxImg src="/static/me/set.png" width="40" height="40" @confirm="setClick"></cxImg>
				</cxView>
			</uni-col>
		</uni-row>
		<cxView margin="20rpx" padding="20rpx" borderRadius="20">
			<cxView>
				<uni-grid :column="4" :showBorder="false" :square="true" @change="(param)=>itemClick(param,item)">
					<uni-grid-item v-for="(item,index) in list" :key="index" :index="index">
						<cxView display="flex" flexDirection="column" justify-content="center" align-items="center"
							height="100%" class="flex1">
							<cxImg :src="item.image" width="80" height="80"></cxImg>
							<cxView color="#333" marginTop="20" size="24">{{item.name}}
							</cxView>
						</cxView>
					</uni-grid-item>

				</uni-grid>
			</cxView>
		</cxView>


		<cxView background="white" padding="20rpx">
			<block v-for="(item,index) in rowList" :key="index">
				<cxView display="flex" justify-content="space-between" padding="20rpx 0">
					<cxView display="flex" align-items="center">
						<cxImg size="30" :src="item.image"></cxImg>
						<cxView marginLeft="20">{{item.name}}</cxView>
					</cxView>
					<cxView display="flex" align-items="center">
						<cxView>

						</cxView>
						<cxImg src="arrow-right" size="20"></cxImg>
					</cxView>
				</cxView>
			</block>
		</cxView>





	</cxView>
</template>

<script>
	export default {
		data() {
			return {
				current: 0,
				title: "hello cx",
				list: [{
						name: "余额",
						image: "/static/me/qianbao.png",
						id: 0,
						path: ""
					},
					{
						name: "资金明细",
						image: "/static/me/zijinmingxi.png",
						id: 20,
						path: ""
					},
					{
						name: "每日签到",
						image: "/static/me/qiandao.png",
						id: 20,
						path: ""
					},
					{
						name: "会员等级",
						image: "/static/me/huiyuandengji.png",
						id: 20,
						path: ""
					}
				],
				rowList: [{
						name: "我的邀请",
						image: "zhuanfa",
					},
					{
						name: "资金管理",
						image: "account",
					},
					{
						name: "系统公告",
						image: "chat",
					},
					{
						name: "使用帮助",
						image: "question-circle",
					},
					{
						name: "意见反馈",
						image: "error-circle",
					},
					{
						name: "联系我们",
						image: "kefu-ermai",
					},

				]
			}
		},
		onLoad() {


		},
		onShow() {

		},

		methods: {


			itemClick(e, data) {
				console.log(e);
				console.log(data);
				let {
					index
				} = e.detail;
				let item = data.data[index];
				console.log(item)
				this.pathMethod(item)

			},
			pathMethod(item) {
				switch (item.id) {
					case 0: {
						// 
					}
					break;
					default:
						break;
				}
			},
			setClick() {
				uni.$u.route({
					url: "/pages/me/set/set",
					params: {}
				})
			}

		}
	}
</script>

<style>

</style>